﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ATM
{
    public partial class AtmView : Form
    {
        AtmModel m_Model;
        Balance balance = new Balance();
        takecash take = new takecash();
        public AtmView()
        {
            m_Model = new AtmModel();
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (true == m_Model.login(textBox1.Text, textBox2.Text))
            {
                take.ShowDialog();
            }
            else
            {
                MessageBox.Show("Wrong Pincode");
            }
        }

        private void AtmView_Load(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (true == m_Model.login(textBox1.Text, textBox2.Text))
            {
                balance.ShowDialog(); 
            }
            else
            {
                MessageBox.Show("Wrong Pincode");
            } 
        }
    }
}
